package com.genexususa.eo.bing.test.delete;

import com.genexususa.eo.bing.connection.AdManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeDeleteAds {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String adsRequestsXML = "<Bing_AdsRequestCollection xmlns=\"L2TMediaDev\">\n" +
                                    "\t<Bing_AdsRequest xmlns=\"L2TMediaDev\">\n" +
                                        "\t\t<GxCampaignId>45616011</GxCampaignId>\n" +
                                        "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                        "\t\t<AdsAdGroupRequestCollection>\n" +
                                            "\t\t\t<AdsAdGroupRequest>\n" +
                                                "\t\t\t\t<GxAdGroupId>452315612</GxAdGroupId>\n" +
                                                "\t\t\t\t<BingAdGroupId>" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                                                "\t\t\t\t<AdCollection>\n" +
                                                    "\t\t\t\t\t<MobileAdCollection>\n" +
                                                        "\t\t\t\t\t\t<MobileAd>\n" +
                                                            "\t\t\t\t\t\t\t<GxMobileAdId>1234567891</GxMobileAdId>\n" +
                                                            "\t\t\t\t\t\t\t<BingMobileAdId>" + testUtil.mobileAdId1 + "</BingMobileAdId>\n" +
                                                        "\t\t\t\t\t\t</MobileAd>\n" +
                                                    "\t\t\t\t\t</MobileAdCollection>\n" +
                                                    "\t\t\t\t\t<TextAdCollection>\n" +
                                                        "\t\t\t\t\t\t<TextAd>\n" +
                                                            "\t\t\t\t\t\t\t<GxTextAdId>1234567892</GxTextAdId>\n" +
                                                            "\t\t\t\t\t\t\t<BingTextAdId>" + testUtil.textAdId1 + "</BingTextAdId>\n" +
                                                        "\t\t\t\t\t\t</TextAd>\n" +
                                                    "\t\t\t\t\t</TextAdCollection>\n" +
                                                "\t\t\t\t</AdCollection>\n" +
                                            "\t\t\t</AdsAdGroupRequest>\n" +
                                        "\t\t</AdsAdGroupRequestCollection>\n" +
                                    "\t</Bing_AdsRequest>\n" +
                                    "\t<Bing_AdsRequest xmlns=\"L2TMediaDev\">\n" +
                                        "\t\t<GxCampaignId>45616012</GxCampaignId>\n" +
                                        "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                        "\t\t<AdsAdGroupRequestCollection>\n" +
                                            "\t\t\t<AdsAdGroupRequest>\n" +
                                                "\t\t\t\t<GxAdGroupId>452315613</GxAdGroupId>\n" +
                                                "\t\t\t\t<BingAdGroupId>" + testUtil.adGroup21 + "</BingAdGroupId>\n" +
                                                "\t\t\t\t<AdCollection>\n" +
                                                    "\t\t\t\t\t<MobileAdCollection>\n" +
                                                        "\t\t\t\t\t\t<MobileAd>\n" +
                                                            "\t\t\t\t\t\t\t<GxMobileAdId>1234567893</GxMobileAdId>\n" +
                                                            "\t\t\t\t\t\t\t<BingMobileAdId>" + testUtil.mobileAdId2 + "</BingMobileAdId>\n" +
                                                        "\t\t\t\t\t\t</MobileAd>\n" +
                                                    "\t\t\t\t\t</MobileAdCollection>\n" +
                                                    "\t\t\t\t\t<TextAdCollection>\n" +
                                                    "\t\t\t\t\t</TextAdCollection>\n" +
                                                "\t\t\t\t</AdCollection>\n" +
                                            "\t\t\t</AdsAdGroupRequest>\n" +
                                            "\t\t\t<AdsAdGroupRequest>\n" +
                                                "\t\t\t\t<GxAdGroupId>452315614</GxAdGroupId>\n" +
                                                "\t\t\t\t<BingAdGroupId>" + testUtil.adGroup22 + "</BingAdGroupId>\n" +
                                                "\t\t\t\t<AdCollection>\n" +
                                                    "\t\t\t\t\t<MobileAdCollection>\n" +
                                                    "\t\t\t\t\t</MobileAdCollection>\n" +
                                                    "\t\t\t\t\t<TextAdCollection>\n" +
                                                        "\t\t\t\t\t\t<TextAd>\n" +
                                                            "\t\t\t\t\t\t\t<GxTextAdId>1234567894</GxTextAdId>\n" +
                                                            "\t\t\t\t\t\t\t<BingTextAdId>" + testUtil.textAdId2 + "</BingTextAdId>\n" +
                                                        "\t\t\t\t\t\t</TextAd>\n" +
                                                    "\t\t\t\t\t</TextAdCollection>\n" +
                                                "\t\t\t\t</AdCollection>\n" +
                                            "\t\t\t</AdsAdGroupRequest>\n" +
                                        "\t\t</AdsAdGroupRequestCollection>\n" +
                                    "\t</Bing_AdsRequest>\n" +
                                "</Bing_AdsRequestCollection>\n";


        /*String adsRequestsXML2 = "<Bing_AdsRequestCollection xmlns=\"L2TMediaDev\">\n" +
                "\t<Bing_AdsRequest xmlns=\"L2TMediaDev\">\n" +
                "\t\t<GxCampaignId>45616011</GxCampaignId>\n" +
                "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                "\t\t<AdsAdGroupRequestCollection>\n" +
                "\t\t\t<AdsAdGroupRequest>\n" +
                "\t\t\t\t<GxAdGroupId>452315612</GxAdGroupId>\n" +
                "\t\t\t\t<BingAdGroupId>" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                "\t\t\t\t<AdCollection>\n" +
                "\t\t\t\t\t<TextAdCollection>" +
                "\t\t\t\t\t\t<TextAd>\n" +
                "\t\t\t\t\t\t\t<GxTextAdId>1234567894</GxTextAdId>\n" +
                "\t\t\t\t\t\t\t<BingTextAdId>" + testUtil.textAdId2 + "</BingTextAdId>\n" +
                "\t\t\t\t\t\t</TextAd>\n" +
                "\t\t\t\t\t</TextAdCollection>\n" +
                "\t\t\t\t</AdCollection>\n" +
                "\t\t\t</AdsAdGroupRequest>\n" +
                "\t\t</AdsAdGroupRequestCollection>\n" +
                "\t</Bing_AdsRequest>\n" +
                "</Bing_AdsRequestCollection>\n";*/

        AdManager resource = new AdManager();
        System.out.println("Consuming DeleteAds.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        String result = resource.deleteAds(customerAccountId, adsRequestsXML);
        System.out.println("Result:\n" + result);
    }
}
